﻿/********************************************************************************
* Author:	Christos Polydorou	(xristos.polydoroy@gmail.com)					*
* Author:	Aris Michail		(aris.michail@gmail.com)						*
* Date:		22/9/2011															*
********************************************************************************/

CREATE PROCEDURE [dbo].[installation]
AS
	DECLARE @usercount bigint
	SELECT @usercount=COUNT(*)
	FROM users

	IF @usercount = 0 
	BEGIN
		EXECUTE userregister @username = 'admin', @password = 'admin', @email = 'email', @fname = 'f', @lname = 'l'
		UPDATE Users
		SET IsEnabled = '1', Usertype = 'adm'
		WHERE users.Username = 'admin'

		EXECUTE DimiourgiaDedomenon
	END
RETURN 0